package avicit.bdp.dms.dss.vo;

import avicit.bdp.core.constant.Constants;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author ma
 * 数据服务VO
 */
@ApiModel("数据订阅VO")
public class DssSubScribeVo {

    /**
     * 订阅ID
     */
    @ApiModelProperty("订阅ID")
    private String id;

    /**
     * 数据资源ID
     */
    @ApiModelProperty("数据资源ID")
    private String dataResourceId;

    /**
     * 资源名称
     */
    @ApiModelProperty("资源名称")
    private String name;

    /**
     * 所属空间
     */
    @ApiModelProperty("所属空间")
    private String projectName;

    /**
     * 发布类型(0-数据1-API接口)
     */
    @ApiModelProperty("发布类型(0-数据1-API接口)")
    private Integer releaseType;

    /**
     * 资源类型 0-数据表 1-文件
     */
    @ApiModelProperty("资源类型 0-数据表 1-文件")
    private Integer type;

    @ApiModelProperty(value = "发布类型")
    private String releaseTypeString;

    @ApiModelProperty(value = "资源类型")
    private String typeString;

    @ApiModelProperty(value = "状态 0-未发布 1-已发布 2-已撤回")
    private Integer status;

    @ApiModelProperty(value = "状态")
    private String statusString;

    /**
     * 标签
     */
    @ApiModelProperty("标签集合")
    private List<String> tags;

    @ApiModelProperty("标签名称，逗号分隔")
    private String tagName;

    /**
     * 审核状态 0-未申请 1-已申请 2-已通过 3-未通过
     */
    @ApiModelProperty("审核状态 0-未申请 1-已申请 2-已通过 3-未通过")
    private Integer auditStatus;

    @ApiModelProperty(value = "审核状态")
    private String auditStatusString;

    /**
     * 订阅人
     */
    @ApiModelProperty("订阅人")
    private String subscribeUser;

    @ApiModelProperty("申请人")
    private String userId;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("申请时间")
    private Date creationDate;

    @ApiModelProperty("分类名称")
    private String typeName;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("密级")
    private String secretLevel;

    @ApiModelProperty("密级名称")
    private String secretLevelName;

    public String getSecretLevel() {
        return secretLevel;
    }

    public void setSecretLevel(String secretLevel) {
        this.secretLevel = secretLevel;
    }

    public String getSecretLevelName() {
        return secretLevelName;
    }

    public void setSecretLevelName(String secretLevelName) {
        this.secretLevelName = secretLevelName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public List<String> getTags() {
        if (StringUtils.isNotBlank(tagName)) {
            return new ArrayList<>(Arrays.asList(tagName.split(Constants.COMMA)));
        }
        return tags;
    }

    public String getTagName() {
        return tagName;
    }

    public void setTagName(String tagName) {
        this.tagName = tagName;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public Integer getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(Integer auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getSubscribeUser() {
        return subscribeUser;
    }

    public void setSubscribeUser(String subscribeUser) {
        this.subscribeUser = subscribeUser;
    }

    public Integer getReleaseType() {
        return releaseType;
    }

    public void setReleaseType(Integer releaseType) {
        this.releaseType = releaseType;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getReleaseTypeString() {
        return releaseTypeString;
    }

    public void setReleaseTypeString(String releaseTypeString) {
        this.releaseTypeString = releaseTypeString;
    }

    public String getTypeString() {
        return typeString;
    }

    public void setTypeString(String typeString) {
        this.typeString = typeString;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusString() {
        return statusString;
    }

    public void setStatusString(String statusString) {
        this.statusString = statusString;
    }

    public String getDataResourceId() {
        return dataResourceId;
    }

    public void setDataResourceId(String dataResourceId) {
        this.dataResourceId = dataResourceId;
    }

    public String getAuditStatusString() {
        return auditStatusString;
    }

    public void setAuditStatusString(String auditStatusString) {
        this.auditStatusString = auditStatusString;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
